package com.supms.patrol.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.common.security.utils.SecurityUtils;
import com.supms.patrol.mapper.DailyInspectionMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.supms.patrol.mapper.DailyInspectionOutclassMapper;
import com.supms.patrol.domain.DailyInspectionOutclass;
import com.supms.patrol.service.IDailyInspectionOutclassService;

/**
 * 提前下课记录 Service业务层处理
 * 
 * @author LiangHao
 * @date 2022-03-15
 */
@Service
public class DailyInspectionOutclassServiceImpl implements IDailyInspectionOutclassService 
{
    @Autowired
    private DailyInspectionOutclassMapper dailyInspectionOutclassMapper;


    /**
     * 查询提前下课记录 
     * 
     * @param id 提前下课记录 主键
     * @return 提前下课记录 
     */
    @Override
    public DailyInspectionOutclass selectDailyInspectionOutclassById(Long id)
    {
        return dailyInspectionOutclassMapper.selectDailyInspectionOutclassById(id);
    }

    /**
     * 查询提前下课记录 列表
     * 
     * @param dailyInspectionOutclass 提前下课记录 
     * @return 提前下课记录 
     */
    @Override
    public List<DailyInspectionOutclass> selectDailyInspectionOutclassList(DailyInspectionOutclass dailyInspectionOutclass)
    {
        String operName = SecurityUtils.getUsername();
        dailyInspectionOutclass.setCreateBy(operName);
        return dailyInspectionOutclassMapper.selectDailyInspectionOutclassList(dailyInspectionOutclass);
    }

    /**
     * 新增提前下课记录 
     * 
     * @param dailyInspectionOutclass 提前下课记录 
     * @return 结果
     */
    @Override
    public int insertDailyInspectionOutclass(DailyInspectionOutclass dailyInspectionOutclass)
    {
        String operName = SecurityUtils.getUsername();
        dailyInspectionOutclass.setCreateBy(operName);
        dailyInspectionOutclass.setCreateTime(DateUtils.getNowDate());
        return dailyInspectionOutclassMapper.insertDailyInspectionOutclass(dailyInspectionOutclass);
    }

    /**
     * 修改提前下课记录 
     * 
     * @param dailyInspectionOutclass 提前下课记录 
     * @return 结果
     */
    @Override
    public int updateDailyInspectionOutclass(DailyInspectionOutclass dailyInspectionOutclass)
    {
        String operName = SecurityUtils.getUsername();
        dailyInspectionOutclass.setUpdateBy(operName);
        dailyInspectionOutclass.setUpdateTime(DateUtils.getNowDate());
        return dailyInspectionOutclassMapper.updateDailyInspectionOutclass(dailyInspectionOutclass);
    }

    /**
     * 批量删除提前下课记录 
     * 
     * @param ids 需要删除的提前下课记录 主键
     * @return 结果
     */
    @Override
    public int deleteDailyInspectionOutclassByIds(Long[] ids)
    {
        return dailyInspectionOutclassMapper.deleteDailyInspectionOutclassByIds(ids);
    }

    /**
     * 删除提前下课记录 信息
     * 
     * @param id 提前下课记录 主键
     * @return 结果
     */
    @Override
    public int deleteDailyInspectionOutclassById(Long id)
    {
        return dailyInspectionOutclassMapper.deleteDailyInspectionOutclassById(id);
    }
}
